<?php
/**
 * <https://y.st./>
 * Copyright © 2016-2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

/**
 * It got to be too difficult keeping track of variable names
 * throughout this website's source code to prevent variable name
 * clashes. All variables are either declared in this file now or have
 * names that are reserved by the comments in this file. That way, new
 * variable names need only be checked against the variable names from
 * this file instead of checked against variable names from every file
 * of this project.
**/

use st\y\abbr, st\y\day_number;

// This website is currently censored by my university. This variable
// holds the number of days until I'm free to fully speak my mind, at
// which point my entire coursework submission archive will go public.
// 
// The "%r" shouldn't be needed if I'm at all watching this date, but
// just in case I space out or something, it's there. It'll add a
// negative sign if we go past zero instead of allowing the default
// behaviour, which would be to start counting up again.
$days_until_freedom = (new DateTimeImmutable('now'))->diff(new \st\y\datetime(2023, 1, 1))->format('%r%a');

// The censored pages are counted as they're processed.
$censored_pages = 0;

// Objects:
$a = abbr::construct_from_file(__DIR__.'/abbr.txt');
$entry = new day_number(2015, 3, 7, 5, 'Day ', ': <\\t\\i\\m\\e>l, Y F d</\\t\\i\\m\\e>');
$entry_untagged = new day_number(2015, 3, 7, 5, 'Day ', ': l, Y F d');

// In-string alias:
$syntax = '\\st\\y\\highlight_string';

// Please note that for signatures to be effective, I cannot give you my key.
// If you want to compile the site on your own machine, you will need to edit the PGP lines here.
$pgp = new gnupg;
$pgp->addsignkey('D135B061DBED690B479FE2E37D83E1E5E7464A03');

// These intervals are used in the navigation menus.
$interval = array(
	'year'  => new DateInterval('P1Y'),
	'month' => new DateInterval('P1M'),
	'day'   => new DateInterval('P1D'),
);

// This is the template we use to build pages:
$template = file_get_contents(__DIR__.'/template/main.xhtml');

// When compiling the weblog navigation, it would be helpful to know when the latest entry is.
$latest_entry = array(
	'year'  => '',
	'month' => '',
	'day'   => '',
);
foreach(scandir(__DIR__.'/pages/en/weblog') as $year):
	if(is_numeric($year) and $year > $latest_entry['year']):
		$latest_entry['year'] = $year;
	endif;
endforeach;
foreach(scandir(__DIR__."/pages/en/weblog/$latest_entry[year]") as $month):
	if($month > $latest_entry['month']):
		$latest_entry['month'] = $month;
	endif;
endforeach;
foreach(scandir(__DIR__."/pages/en/weblog/$latest_entry[year]/$latest_entry[month]") as $day):
	if($day > $latest_entry['day']):
		$latest_entry['day'] = $day;
	endif;
endforeach;

$latest_copyright_year = $latest_entry['year'];

$latest_entry = array(
	'year' => "/en/weblog/$latest_entry[year]/",
	'month' => "/en/weblog/$latest_entry[year]/$latest_entry[month]/",
	'day' => "/en/weblog/$latest_entry[year]/$latest_entry[month]/$latest_entry[day]",
);

// This is just to catch invalid arguments
$valid_arguments = array(
	'--canary',
);

foreach($argv as $key => $value):
// The "and $key" part prevents the script from treating the file name as an invalid argument.
// $argv[0] will always be the file name and 0 evaluates to false.
	if(!in_array($value, $valid_arguments) and $key):
		$invalid_arguments[] = $value;
	endif;
endforeach;

// This array includes the names of all files that should not be
// deleted from the compiled version of the website. Any page that
// still has source code should have an entry in this array. If a page
// is removed from the source code, it shouldn't be added to this array
// during compilation time, which will result in that page being
// removed from the compiled version. That way, we can recompile the
// website without keeping pages that should be removed and without
// erasing all already-compiled pages from disk before compiling them
// if their source code hasn't been modified.
$should_exist = array();

// Used by the ASCII calendar pages:
$months = array(
	1  => '01-January',
	2  => '02-February',
	3  => '03-March',
	4  => '04-April',
	5  => '05-May',
	6  => '06-June',
	7  => '07-July',
	8  => '08-August',
	9  => '09-September',
	10 => '10-October',
	11 => '11-November',
	12 => '12-December',
);
$monthheads = array(
	1  => '  January',
	2  => ' February',
	3  => '    March',
	4  => '    April',
	5  => '      May',
	6  => '     June',
	7  => '     July',
	8  => '   August',
	9  => 'September',
	10 => '  October',
	11 => ' November',
	12 => ' December',
);

// Previously, when I added new assignment submissions to my list of
// coursework, I had to manually update both the coursework index and
// the navigation menu of the course that the assignment was for. With
// this array, I can now instead only update in one place instead of
// two.
$coursework = array(
	'BUS1101' => array(
		'title' => 'BUS 1101: Principles of Business Management',
		'subtitle' => "<span title=\"{$entry(2016, 11, 10)}\">2016-11-10</span> to <span title=\"{$entry(2017, 1, 11)}\">2017-01-11</span>",
		'assignments' => array(
			'Leadership_Entrepreneurship_and_Strategy' => array(
				'title' => 'Leadership, Entrepreneurship, and Strategy',
				'unit' => '1',
			),
			'Behaviour_management_at_the_SAS_Institute' => array(
				'title' => 'Behaviour management at the SAS Institute',
				'unit' => '2',
			),
			'How_Coca-Cola_should_deal_with_globalization' => array(
				'title' => 'How Coca-Cola should deal with globalization',
				'unit' => '3',
			),
			'SCAMPER' => array(
				'title' => 'SCAMPER',
				'unit' => '4',
			),
			'Strengths_weaknesses_opportunities_and_threats' => array(
				'title' => 'Strengths, weaknesses, opportunities, and threats',
				'unit' => '5',
			),
			'Microsoft_and_corporate_social_responsibility' => array(
				'title' => 'Microsoft and corporate social responsibility',
				'unit' => '6',
			),
			'Three_types_of_organizational_structures' => array(
				'title' => 'Three types of organizational structures',
				'unit' => '7',
			),
			'Little_Caesars_culture' => array(
				'title' => 'Little Caesars culture',
				'unit' => '8',
			),
		),
	),
	'CS1101' => array(
		'title' => 'CS 1101: Programming Fundamentals',
		'subtitle' => "<span title=\"{$entry(2017, 1, 26)}\">2017-01-26</span> to <span title=\"{$entry(2017, 3, 29)}\">2017-03-29</span>",
		'assignments' => array(
			't_area.py' => array(
				'title' => 't_area.py',
				'unit' => '2',
			),
			'calculator_flowchart' => array(
				'title' => 'calculator flowchart',
				'unit' => '3',
			),
			'tryme3.py' => array(
				'title' => 'tryme3.py',
				'unit' => '4',
			),
			'mycalc.py' => array(
				'title' => 'mycalc.py',
				'unit' => '5',
			),
			'bool.py' => array(
				'title' => 'bool.py',
				'unit' => '6',
			),
			'sort_fruits.py' => array(
				'title' => 'sort_fruits.py',
				'unit' => '7',
			),
		),
	),
	'CS1102' => array(
		'title' => 'CS 1102: Programming 1',
		'subtitle' => "<span title=\"{$entry(2017, 4, 6)}\">2017-04-06</span> to <span title=\"{$entry(2017, 6, 7)}\">2017-06-07</span>",
		'assignments' => array(
			'GravityCalculator.java' => array(
				'title' => 'GravityCalculator.java',
				'unit' => '1',
			),
			'SnakeEyesCount.java' => array(
				'title' => 'SnakeEyesCount.java',
				'unit' => '2',
			),
			'Unit3.java' => array(
				'title' => 'Unit3.java',
				'unit' => '3',
			),
			'firstsubroutines.java' => array(
				'title' => 'firstsubroutines.java',
				'unit' => '4',
			),
			'Unit5.java' => array(
				'title' => 'Unit5.java',
				'unit' => '5',
			),
			'payrollsystem' => array(
				'title' => 'package payrollsystem;',
				'unit' => '7',
			),
			'matchbox' => array(
				'title' => 'package matchbox;',
				'unit' => '6',
			),
			'Unit7.java' => array(
				'title' => 'Unit7.java',
				'unit' => '7',
			),
		),
	),
	'CS1103' => array(
		'title' => 'CS 1103: Programming 2',
		'subtitle' => "<span title=\"{$entry(2017, 6, 15)}\">2017-06-15</span> to <span title=\"{$entry(2017, 8, 16)}\">2017-08-16</span>",
		'assignments' => array(
			'Unit1.java' => array(
				'title' => 'Unit1.java',
				'unit' => '1',
			),
			'SimpleRandomSentences.java' => array(
				'title' => 'SimpleRandomSentences.java',
				'unit' => '2',
			),
			'Tape.java' => array(
				'title' => 'Tape.java',
				'unit' => '3',
			),
			'Debugging' => array(
				'title' => 'Debugging',
				'unit' => '4',
			),
			'Unit5.java' => array(
				'title' => 'Unit5.java',
				'unit' => '5',
			),
			'DrawTextPanel.java' => array(
				'title' => 'DrawTextPanel.java',
				'unit' => '6',
			),
			'Unit7.java' => array(
				'title' => 'Unit7.java',
				'unit' => '7',
			),
		),
	),
	'CS1104' => array(
		'title' => 'CS 1104: Computer Systems',
		'subtitle' => "<span title=\"{$entry(2017, 11, 16)}\">2017-11-16</span> to <span title=\"{$entry(2018, 1, 17)}\">2018-01-17</span>",
		'assignments' => array(
			'Circuits' => array(
				'title' => 'Circuits',
				'unit' => '2',
			),
			'4-bit_arithmetic_logic_unit' => array(
				'title' => '4-bit arithmetic logic unit',
				'unit' => '3',
			),
			'4-bit_arithmetic_logic_unit_with_registers' => array(
				'title' => '4-bit arithmetic logic unit with registers',
				'unit' => '4',
			),
			'Computer_parts_and_purposes' => array(
				'title' => 'Computer parts and purposes',
				'unit' => '5',
			),
			'Assembly' => array(
				'title' => 'Assembly',
				'unit' => '6',
			),
			'Assembly~_revisited~_some_assembly_required' => array(
				'title' => 'Assembly, revisited: some assembly required',
				'unit' => '7',
			),
		),
	),
	'CS2203' => array(
		'title' => 'CS 2203: Databases 1',
		'subtitle' => "<span title=\"{$entry(2017, 6, 15)}\">2017-06-15</span> to <span title=\"{$entry(2017, 8, 16)}\">2017-08-16</span>",
		'assignments' => array(
			'Library_database_relations' => array(
				'title' => 'Library database relations',
				'unit' => '1',
			),
			'Library_database_relations~_continued' => array(
				'title' => 'Library database relations, continued',
				'unit' => '2',
			),
			'Library_database_relation_diagram' => array(
				'title' => 'Library database relation diagram',
				'unit' => '3',
			),
			'Library_database_normalisation' => array(
				'title' => 'Library database normalisation',
				'unit' => '4',
			),
			'Library_database_SQL' => array(
				'title' => 'Library database SQL',
				'unit' => '5',
			),
			'Library_database_SQL~_continued' => array(
				'title' => 'Library database SQL, continued',
				'unit' => '6',
			),
			'Library_database_SQL_select' => array(
				'title' => 'Library database SQL select',
				'unit' => '7',
			),
		),
	),
	'CS2204' => array(
		'title' => 'CS 2204: Communications and Networking',
		'subtitle' => "<span title=\"{$entry(2018, 04, 12)}\">2018-04-12</span> to <span title=\"{$entry(2018, 6, 13)}\">2018-06-13</span>",
		'assignments' => array(
			'Connection-oriented_and_connectionless_transmissions' => array(
				'title' => 'Connection-oriented and connectionless transmissions',
				'unit' => '1',
			),
			'More_about_transmission' => array(
				'title' => 'More about transmission',
				'unit' => '2',
			),
			'Transmission issues~_encoding~_and_checksums' => array(
				'title' => 'Transmission issues, encoding, and checksums',
				'unit' => '3',
			),
			'Addressing_and_packet_lengths' => array(
				'title' => 'Addressing and packet lengths',
				'unit' => '4',
			),
			'Routing' => array(
				'title' => 'Routing',
				'unit' => '5',
			),
			'UDP' => array(
				'title' => 'UDP',
				'unit' => '6',
			),
			'Packets' => array(
				'title' => 'Packets',
				'unit' => '7',
			),
		),
	),
	'CS2205' => array(
		'title' => 'CS 2205: Web Programming 1',
		'subtitle' => "<span title=\"{$entry(2017, 9, 7)}\">2017-09-07</span> to <span title=\"{$entry(2017, 11, 8)}\">2017-11-08</span>",
		'assignments' => array(
			'Markup_validation' => array(
				'title' => 'Markup validation',
				'unit' => '1',
			),
			'Wix' => array(
				'title' => 'Wix',
				'unit' => '2',
			),
			'Unit_3' => array(
				'title' => 'CS 2205 Unit 3',
				'unit' => '3',
			),
			'Codecademy' => array(
				'title' => 'Codecademy',
				'unit' => '4',
			),
			'Codecademy~_revisited' => array(
				'title' => 'Codecademy, revisited',
				'unit' => '5',
			),
			'XML' => array(
				'title' => 'XML',
				'unit' => '6',
			),
			'Codecademy~s_hidden_PHP_section' => array(
				'title' => 'Codecademy&apos;s hidden PHP section',
				'unit' => '7',
			),
		),
	),
	'CS2301' => array(
		'title' => 'CS 2301: Operating Systems 1',
		'subtitle' => "<span title=\"{$entry(2017, 9, 7)}\">2017-09-07</span> to <span title=\"{$entry(2017, 11, 8)}\">2017-11-08</span>",
		'assignments' => array(
			'Forking' => array(
				'title' => 'Forking',
				'unit' => '2',
			),
			'Resource_management' => array(
				'title' => 'Resource management',
				'unit' => '4',
			),
			'Process_Explorer' => array(
				'title' => 'Process Explorer',
				'unit' => '5',
			),
			'Paging' => array(
				'title' => 'Paging',
				'unit' => '6',
			),
			'NTFSInfo' => array(
				'title' => 'NTFSInfo',
				'unit' => '7',
			),
		),
	),
	'CS2401' => array(
		'title' => 'CS 2401: Software Engineering 1',
		'subtitle' => "<span title=\"{$entry(2017, 11, 16)}\">2017-11-16</span> to <span title=\"{$entry(2018, 1, 17)}\">2018-01-17</span>",
		'assignments' => array(
			'Acceptance_tests' => array(
				'title' => 'Acceptance tests',
				'unit' => '2',
			),
			'Garage_door_system' => array(
				'title' => 'Garage door system',
				'unit' => '3',
			),
			'Triangles' => array(
				'title' => 'Triangles',
				'unit' => '5',
			),
			'Complexity' => array(
				'title' => 'Complexity',
				'unit' => '6',
			),
		),
	),
	'CS3303' => array(
		'title' => 'CS 3303: Data Structures',
		'subtitle' => "<span title=\"{$entry(2018, 11, 15)}\">2018-11-14</span> to <span title=\"{$entry(2019, 1, 16)}\">2019-01-16</span>",
		'assignments' => array(
			'Stack' => array(
				'title' => 'Stack',
				'unit' => '3',
			),
			'Binary_search_tree' => array(
				'title' => 'Binary search tree',
				'unit' => '4',
			),
			'Quick_sort' => array(
				'title' => 'Quick sort',
				'unit' => '6',
			),
		),
	),
	'CS3304' => array(
		'title' => 'CS 3304: Analysis of Algorithms',
		'subtitle' => "<span title=\"{$entry(2020, 1, 30)}\">2020-01-30</span> to <span title=\"{$entry(2020, 4, 1)}\">2019-04-01</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'CS3305' => array(
		'title' => 'CS 3305: Web Programming 2',
		'subtitle' => "<span title=\"{$entry(2019, 01, 31)}\">2019-01-31</span> to <span title=\"{$entry(2019, 4, 3)}\">2019-04-03</span>",
		'assignments' => array(
			'Online_PHP_interpreter' => array(
				'title' => "Online $a[PHP] interpreter",
				'unit' => '2',
			),
			'PHP_course_dashboard' => array(
				'title' => "$a[PHP] course dashboard",
				'unit' => '3',
			),
			'PHP_course_dashboard~_reprise' => array(
				'title' => "$a[PHP] course dashboard, reprise",
				'unit' => '4',
			),
			'Catalyst_Coders' => array(
				'title' => 'Catalyst Coders',
				'unit' => '5',
			),
			'CS3305-Alexand~er~ra~_Yst-Joomla~s Site' => array(
				'title' => 'CS3305-Alexand(er|ra) Yst-Joomla&apos;s Site',
				'unit' => '6',
			),
			'Weblinks' => array(
				'title' => 'Weblinks',
				'unit' => '7',
			),
		),
	),
	'CS3306' => array(
		'title' => 'CS 3306: Databases 2',
		'subtitle' => "<span title=\"{$entry(2019, 4, 11)}\">2019-04-11</span> to <span title=\"{$entry(2019, 6, 12)}\">2019-06-12</span>",
		'assignments' => array(
			'Entity-relationship_diagram' => array(
				'title' => 'Entity-relationship diagram',
				'unit' => '1',
			),
			'Deadlocks' => array(
				'title' => 'Deadlocks',
				'unit' => '2',
			),
			'Access_control' => array(
				'title' => 'Access control',
				'unit' => '4',
			),
			'Backups' => array(
				'title' => 'Backups',
				'unit' => '5',
			),
			'Classification_tree' => array(
				'title' => 'Classification tree',
				'unit' => '7',
			),
		),
	),
	'CS3307' => array(
		'title' => 'CS 3307: Operating Systems 2',
		'subtitle' => "<span title=\"{$entry(2019, 4, 11)}\">2019-04-11</span> to <span title=\"{$entry(2019, 6, 12)}\">2019-06-12</span>",
		'assignments' => array(
			'Processes' => array(
				'title' => 'Processes',
				'unit' => '2',
			),
			'Hardware' => array(
				'title' => 'Hardware',
				'unit' => '4',
			),
			'Filesystems' => array(
				'title' => 'Filesystems',
				'unit' => '5',
			),
			'Permissions' => array(
				'title' => 'Permissions',
				'unit' => '7',
			),
		),
	),
	'CS3308' => array(
		'title' => 'CS 3308: Information Retrieval',
		'subtitle' => "<span title=\"{$entry(2020, 1, 30)}\">2020-01-30</span> to <span title=\"{$entry(2020, 4, 1)}\">2019-04-01</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'CS4402' => array(
		'title' => 'CS 4402: Comparative Programming Languages',
		'subtitle' => "<span title=\"{$entry(2018, 11, 15)}\">2018-11-14</span> to <span title=\"{$entry(2019, 1, 16)}\">2019-01-16</span>",
		'assignments' => array(),
	),
	'CS4403' => array(
		'title' => 'CS 4403: Software Engineering 2',
		'subtitle' => "<span title=\"{$entry(2019, 9, 5)}\">2019-09-05</span> to <span title=\"{$entry(2019, 11, 6)}\">2019-11-06</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'CS4404' => array(
		'title' => 'CS 4404: Advanced Networking and Data Security',
		'subtitle' => "<span title=\"{$entry(2019, 9, 5)}\">2019-09-05</span> to <span title=\"{$entry(2019, 11, 6)}\">2019-11-06</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'CS4405' => array(
		'title' => 'CS 4405: Mobile Applications',
		'subtitle' => "<span title=\"{$entry(2019, 6, 20)}\">2019-06-20</span> to <span title=\"{$entry(2019, 8, 21)}\">2019-08-21</span>",
		'assignments' => array(
			'Prototype' => array(
				'title' => 'Prototype',
				'unit' => '1',
			),
			'Create_Project_Sunshine' => array(
				'title' => 'Create Project Sunshine',
				'unit' => '2',
			),
			'Course_completion' => array(
				'title' => 'Course completion',
				'unit' => '6',
			),
		),
	),
	'CS4406' => array(
		'title' => 'CS 4406: Computer Graphics',
		'subtitle' => "<span title=\"{$entry(2019, 6, 20)}\">2019-06-20</span> to <span title=\"{$entry(2019, 8, 21)}\">2019-08-21</span>",
		'assignments' => array(
			'Ungraded' => array(
				'title' => 'Ungraded',
				'unit' => '1',
			),
			'Assignment_~2_for_CS4406_Computer_Graphics' => array(
				'title' => 'Assignment #2 for CS4406 Computer Graphics',
				'unit' => '2',
			),
			'Assignment_~3_for_CS4406_Computer_Graphics' => array(
				'title' => 'Assignment #3 for CS4406 Computer Graphics',
				'unit' => '3',
			),
			'Assignment_~4_for_CS4406_Computer_Graphics' => array(
				'title' => 'Assignment #4 for CS4406 Computer Graphics',
				'unit' => '4',
			),
			'Assignment_~5_for_CS4406_Computer_Graphics' => array(
				'title' => 'Assignment #5 for CS4406 Computer Graphics',
				'unit' => '5',
			),
			'Assignment_~6_for_CS4406_Computer_Graphics.html' => array(
				'title' => 'Assignment #6 for CS4406 Computer Graphics',
				'unit' => '6',
			),
			'Assignment_~7_for_CS4406_Computer_Graphics.html' => array(
				'title' => 'Assignment #7 for CS4406 Computer Graphics',
				'unit' => '7',
			),
		),
	),
	'CS4407' => array(
		'title' => 'CS 4407: Data Mining and Machine Learning',
		'subtitle' => "<span title=\"{$entry(2019, 01, 31)}\">2019-01-31</span> to <span title=\"{$entry(2019, 4, 3)}\">2019-04-03</span>",
		'assignments' => array(
			'Lab~_Introduction_to_R' => array(
				'title' => 'Lab: Introduction to R',
				'unit' => '1',
			),
			'Components_of_data_mining' => array(
				'title' => 'Components of data mining',
				'unit' => '2',
			),
			'Linear_regression' => array(
				'title' => 'Linear regression',
				'unit' => '3',
			),
			'class~~knn~~' => array(
				'title' => 'class::knn()',
				'unit' => '4',
			),
			'Ionosphere' => array(
				'title' => 'Ionosphere',
				'unit' => '5',
			),
			'Failed_neural_network' => array(
				'title' => 'Failed neural network',
				'unit' => '6',
			),
			'Failed_neural_network~_evaluation' => array(
				'title' => 'Failed neural network: evaluation',
				'unit' => '7',
			),
		),
	),
	'CS4408' => array(
		'title' => 'CS 4408: Artificial Intelligence',
		'subtitle' => "<span title=\"{$entry(2020, 4, 9)}\">2020-04-09</span> to <span title=\"{$entry(2020, 6, 10)}\">2019-06-10</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'ENGL1102' => array(
		'title' => 'ENGL 1102: English Composition 2',
		'subtitle' => "<span title=\"{$entry(2018, 2, 1)}\">2017-11-16</span> to <span title=\"{$entry(2018, 4, 4)}\">2018-01-17</span>",
		'assignments' => array(
			'Drudgery' => array(
				'title' => 'Drudgery',
				'unit' => '1',
			),
			'Death_and_Odysseus' => array(
				'title' => 'Death and Odysseus',
				'unit' => '2',
			),
			'Consumer_ethics' => array(
				'title' => 'Consumer ethics',
				'unit' => '4',
			),
			'Implications_of_the_Internet' => array(
				'title' => 'Implications of the Internet',
				'unit' => '5',
			),
			'References' => array(
				'title' => 'References',
				'unit' => '6',
			),
			'Abstracts' => array(
				'title' => 'Abstracts',
				'unit' => '7',
			),
		),
	),
	'ENGL1405' => array(
		'title' => 'ENGL 1405: World Literature',
		'subtitle' => "<span title=\"{$entry(2018, 6, 21)}\">2018-06-21</span> to <span title=\"{$entry(2018, 8, 22)}\">2018-08-22</span>",
		'assignments' => array(
			'Back_in_the_day' => array(
				'title' => 'Back in the day',
				'unit' => '1',
			),
			'Dear_Diary' => array(
				'title' => 'Dear Diary',
				'unit' => '2',
			),
			'Double_murder_suicide' => array(
				'title' => 'Double murder suicide',
				'unit' => '4',
			),
			'A_romantic_evening_for_three' => array(
				'title' => 'A romantic evening for three',
				'unit' => '5',
			),
			'The_Marvellous_Land_of_Oz' => array(
				'title' => 'The Marvellous Land of Oz',
				'unit' => '7',
			),
		),
	),
	'ENVS1301' => array(
		'title' => 'ENVS 1301: Introduction to Environmental Science',
		'subtitle' => "<span title=\"{$entry(2018, 04, 12)}\">2018-04-12</span> to <span title=\"{$entry(2018, 6, 13)}\">2018-06-13</span>",
		'assignments' => array(
			'Impact_on_the_carbon_cycle' => array(
				'title' => 'Impact on the carbon cycle',
				'unit' => '4',
			),
			'Lane_Regional_Air_Protection_Agency' => array(
				'title' => 'Lane Regional Air Protection Agency',
				'unit' => '6',
			),
		),
	),
	'HIST1421' => array(
		'title' => 'HIST 1421: Greek and Roman Civilization',
		'subtitle' => "<span title=\"{$entry(2017, 4, 6)}\">2017-04-06</span> to <span title=\"{$entry(2017, 6, 7)}\">2017-06-07</span>",
		'assignments' => array(
			'Politics_in_Athens_and_Sparta' => array(
				'title' => 'Politics in Athens and Sparta',
				'unit' => '1',
			),
			'Forms_of_government_in_ancient_Greece' => array(
				'title' => 'Forms of government in ancient Greece',
				'unit' => '2',
			),
			'Inequalities_in_Rome' => array(
				'title' => 'Inequalities in Rome',
				'unit' => '4',
			),
			'The_first_Punic_war' => array(
				'title' => 'The first Punic war',
				'unit' => '5',
			),
			'Concrete_and_arches' => array(
				'title' => 'Concrete and arches',
				'unit' => '7',
			),
		),
	),
	'MATH1201' => array(
		'title' => 'MATH 1201: College Algebra',
		'subtitle' => "<span title=\"{$entry(2018, 2, 1)}\">2017-11-16</span> to <span title=\"{$entry(2018, 4, 4)}\">2018-01-17</span>",
		'assignments' => array(
			'Functions' => array(
				'title' => 'Functions',
				'unit' => '1',
			),
			'Lines' => array(
				'title' => 'Lines',
				'unit' => '2',
			),
			'Polynomials' => array(
				'title' => 'Polynomials',
				'unit' => '3',
			),
			'Inverses_and_composites' => array(
				'title' => 'Inverses and composites',
				'unit' => '4',
			),
			'Logarithms' => array(
				'title' => 'Logarithms',
				'unit' => '5',
			),
			'Systems_of_equations' => array(
				'title' => 'Systems of equations',
				'unit' => '6',
			),
			'Trigonometry' => array(
				'title' => 'Trigonometry',
				'unit' => '7',
			),
		),
	),
	'MATH1211' => array(
		'title' => 'MATH 1211: Calculus',
		'subtitle' => "<span title=\"{$entry(2019, 11, 14)}\">2019-11-14</span> to <span title=\"{$entry(2020, 1, 15)}\">2019-01-15</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'MATH1280' => array(
		'title' => 'MATH 1280: Introduction to Statistics',
		'subtitle' => "<span title=\"{$entry(2018, 9, 5)}\">2018-09-05</span> to <span title=\"{$entry(2018, 11, 7)}\">2018-11-07</span>",
		'assignments' => array(
			'Using_R' => array(
				'title' => 'Using R',
				'unit' => '2',
			),
			'Data~_a_random_variable~_and_a_population' => array(
				'title' => 'Data, a random variable, and a population',
				'unit' => '4',
			),
			'Distributions' => array(
				'title' => 'Distributions',
				'unit' => '6',
			),
		),
	),
	'MATH1302' => array(
		'title' => 'MATH 1302: Discrete Mathematics',
		'subtitle' => "<span title=\"{$entry(2019, 11, 14)}\">2019-11-14</span> to <span title=\"{$entry(2020, 1, 15)}\">2019-01-15</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'PHIL1402' => array(
		'title' => 'PHIL 1402: Introduction to Philosophy',
		'subtitle' => "<span title=\"{$entry(2018, 6, 21)}\">2018-06-21</span> to <span title=\"{$entry(2018, 8, 22)}\">2018-08-22</span>",
		'assignments' => array(
			'Thucydides' => array(
				'title' => 'Thucydides',
				'unit' => '1',
			),
			'Immanuel_Kant' => array(
				'title' => 'Immanuel Kant',
				'unit' => '2',
			),
			'Gods' => array(
				'title' => 'Gods',
				'unit' => '3',
			),
			'Thoughts_on_this_week~s_readings' => array(
				'title' => 'Thoughts on this week&apos;s readings',
				'unit' => '4',
			),
			'Male_genital_mutilation' => array(
				'title' => 'Male genital mutilation',
				'unit' => '5',
			),
			'Truth' => array(
				'title' => 'Truth',
				'unit' => '6',
			),
			'Humans_are_terrible' => array(
				'title' => 'Humans are terrible',
				'unit' => '7',
			),
		),
	),
	'PHIL1404' => array(
		'title' => 'PHIL 1404: Ethics and Social Responsibility',
		'subtitle' => "<span title=\"{$entry(2017, 1, 26)}\">2017-01-26</span> to <span title=\"{$entry(2017, 3, 29)}\">2017-03-29</span>",
		'assignments' => array(
			'Apple_and_ethics' => array(
				'title' => 'Apple and ethics',
				'unit' => '1',
			),
			'Cultural_relativism' => array(
				'title' => 'Cultural relativism',
				'unit' => '3',
			),
			'Artificial_value' => array(
				'title' => 'Artificial value',
				'unit' => '5',
			),
			'Caveat_emptor_and_the_McDonald~s_coffee_case' => array(
				'title' => 'Caveat emptor and the McDonald&apos;s coffee case',
				'unit' => '7',
			),
		),
	),
	'POLS1503' => array(
		'title' => 'POLS 1503: Globalization',
		'subtitle' => "<span title=\"{$entry(2016, 9, 1)}\">2016-09-01</span> to <span title=\"{$entry(2016, 11, 2)}\">2016-11-02</span>",
		'assignments' => array(
			'The_World_Bank_and_the_Integrated_Storm_Water_Drain_project_in_Chennai' => array(
				'title' => 'The World Bank and the Integrated Storm Water Drain project in Chennai',
				'unit' => '2',
			),
			'The_Electronic_Frontier_Foundation' => array(
				'title' => 'The Electronic Frontier Foundation',
				'unit' => '3',
			),
			'The_Canadian_Magazine_Dispute_and_an_Exemption_for_Whaling' => array(
				'title' => 'The Canadian Magazine Dispute and an Exemption for Whaling',
				'unit' => '6',
			),
			'Global_pathogens_and_GMOs' => array(
				'title' => 'Global pathogens and GMOs',
				'unit' => '7',
			),
		),
	),
	'PSYC1111' => array(
		'title' => 'PSYC 1111: Introduction to Health Psychology (previously known 
as Introduction to Human Psychology)',
		'subtitle' => "<span title=\"{$entry(2018, 9, 5)}\">2018-09-05</span> to <span title=\"{$entry(2018, 11, 7)}\">2018-11-07</span>",
		'assignments' => array(
			'Fatima' => array(
				'title' => 'Fatima',
				'unit' => '1',
			),
			'Health_beliefs' => array(
				'title' => 'Health beliefs',
				'unit' => '2',
			),
			'Using_emotion_to_affect_health-related_behaviours' => array(
				'title' => 'Using emotion to affect health-related behaviours',
				'unit' => '3',
			),
			'Magda' => array(
				'title' => 'Magda',
				'unit' => '4',
			),
			'Weblogging_about_chronic_pain_and_illness' => array(
				'title' => 'Weblogging about chronic pain and illness',
				'unit' => '5',
			),
			'Psychology_and_chronic_illness' => array(
				'title' => 'Psychology and chronic illness',
				'unit' => '6',
			),
			'Gender_differences_in_illness' => array(
				'title' => 'Gender differences in illness',
				'unit' => '7',
			),
		),
	),
	'PSYC1205' => array(
		'title' => 'PSYC 1205: Emotional intelligence (EI)',
		'subtitle' => "<span title=\"{$entry(2020, 4, 9)}\">2020-04-09</span> to <span title=\"{$entry(2020, 6, 10)}\">2019-06-10</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'PSYC1504' => array(
		'title' => 'PSYC 1504: Introduction to Psychology',
		'subtitle' => "<span title=\"{$entry(2020, 6, 18)}\">2020-06-18</span> to <span title=\"{$entry(2020, 8, 19)}\">2019-08-19</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'SOC1502' => array(
		'title' => 'SOC 1502: Introduction to Sociology',
		'subtitle' => "<span title=\"{$entry(2020, 6, 18)}\">2020-06-18</span> to <span title=\"{$entry(2020, 8, 19)}\">2019-08-19</span>",
		'assignments' => array(
			'Unit_1_essay' => array(
				'title' => 'title',
				'unit' => '1',
			),
			'Unit_2_essay' => array(
				'title' => 'title',
				'unit' => '2',
			),
			'Unit_3_essay' => array(
				'title' => 'title',
				'unit' => '3',
			),
			'Unit_4_essay' => array(
				'title' => 'title',
				'unit' => '4',
			),
			'Unit_5_essay' => array(
				'title' => 'title',
				'unit' => '5',
			),
			'Unit_6_essay' => array(
				'title' => 'title',
				'unit' => '6',
			),
			'Unit_7_essay' => array(
				'title' => 'title',
				'unit' => '7',
			),
		),
	),
	'UNIV1001' => array(
		'title' => 'UNIV 1001: Online Education Strategies',
		'subtitle' => "<span title=\"{$entry(2016, 9, 1)}\">2016-09-01</span> to <span title=\"{$entry(2016, 11, 2)}\">2016-11-02</span>",
		'assignments' => array(
			'Free_Business_Models_and_Why_They_Matter_to_Me' => array(
				'title' => 'Free Business Models and Why They Matter to Me',
				'unit' => '2',
			),
			'Proctoring' => array(
				'title' => 'Proctoring',
				'unit' => '3',
			),
			'Student_Success' => array(
				'title' => 'Student Success',
				'unit' => '4',
			),
			'Notes' => array(
				'title' => 'Notes',
				'unit' => '6',
			),
			'A_conflict_with_T-Mobile' => array(
				'title' => 'A conflict with T-Mobile',
				'unit' => '7',
			),
		),
	),
);

// Goal list data:
$goals = array(
	'bachelor' => array(
		'title' => 'Finish my bachelor degree',
		'priority' => 'high',
		'urgency' => 'high',
		'postrequisites' => array(
			'martial' => true,
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		For a number of reasons, this cannot be put off.
		Not least of those reasons is that the completion of this degree marks the beginning of the countdown after which the school&apos;s censorship of my website ends.
	</p>
END
	),
	'new_job' => array(
		'title' => 'Get a new job',
		'priority' => 'high',
		'urgency' => 'medium',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		My current work environment is toxic and I need to escape.
	</p>
	<p>
		Additionally, people are resistant to change.
		Even the people I&apos;ve asked to refer to me as a &quot;they&quot; refuse.
		In a brand new environment, I feel I would be more comfortable insisting and, as people wouldn&apos;t already be used to thinking of me as a man, people would be less resistant to accepting the fact that I&apos;m not one.
	</p>
END
	),
	'good_job' => array(
		'title' => 'Get a good job',
		'priority' => 'high',
		'urgency' => 'high',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		I want to not only escape my current, toxic work environment, but also move to a work environment in which I can actually stand behind what I do and enjoy it.
		I&apos;ve got to finish learning to type before I can qualify for such a job though, and with how long that&apos;ll take me, I&apos;ll probably have my associate degree completed.
	</p>
END
	),
	'hair' => array(
		'title' => 'Look into permanent hair removal',
		'priority' => 'low',
		'urgency' => 'low',
		'postrequisites' => array(
			'voice' => true,
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		Even right after I shave my face, the dark roots of my hair show through my skin.
		Shaving therefore doesn&apos;t even fix the facial hair problem fully even on a temporary basis.
		And then, it doesn&apos;t take long for it to grow back out.
		I need to look into something that will remove the hair at a deeper and likely permanent level.
		I wouldn&apos;t mind a permanent solution to arm, leg, and especially chest hair as well.
	</p>
END
	),
	'voice' => array(
		'title' => 'Look into voice lessons',
		'priority' => 'medium',
		'urgency' => 'medium',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		My voice is too masculine.
		I&apos;d like to get lessons to feminise it.
		I don&apos;t think I want to go through full feminisation through hormones and such, but having a sifter voice shouldn&apos;t be too much to ask.
		A feminine voice isn&apos;t going to help me pull off an androgynous air if I haven&apos;t already dealt with my facial hair problem though.
	</p>
END
	),
	'IRA' => array(
		'title' => "Deal with $a[IRA] paperwork",
		'priority' => 'medium',
		'urgency' => 'high',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		The head manager at work gave me paperwork relating to the company&apos;s new $a[IRA] provider.
		I need to actually deal with the paperwork soon to be sure there aren&apos;t further problems I need the person in charge to correct.
	</p>
END
	),
	'Internet' => array(
		'title' => 'Get a home Internet connection set up',
		'priority' => 'medium',
		'urgency' => 'low',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		My current laptop stopped freezing on me, so my fear that it&apos;s going to give up the ghost soon has subsided.
		However, when it does finally die, I&apos;ll need to have already set up a home Internet connection to continue my coursework.
		My current laptop is using Wi-Fi with a $a[MAC] address whitelist, and the new machine has no way to get onto that whitelist.
		Additionally, having a home Internet connection will allow me to run a Minetest server and Web server.
		Palette Game has postponed the opening of my Minetest server by quite a bit though, as I need to now get the game into a usable state before opening the world to the public instead of just using the pre-built Minetest Game with a few extra mods.
	</p>
END
	),
	'CSS' => array(
		'title' => "Finish the $a[CSS] test page for $a[XHTML] elements",
		'priority' => 'low',
		'urgency' => 'low',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		I started building a test page that would demonstrate how my website&apos;s $a[CSS] causes all valid $a[XHTML] elements to render, but didn&apos;t have time to finish it.
		Having it done would help me notice bugs in the $a[CSS].
	</p>
END
	),
	'variables' => array(
		'title' => 'Add variable use checks to this website&apos;s build scripts',
		'priority' => 'low',
		'urgency' => 'low',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		To avoid variables getting overwritten by files in ways other files don&apos;t expect and to avoid unexpected values in variables files don&apos;t expect to be set yet, all variables are supposed to be set or reserved in one file of this website&apos;s build scripts.
		At some point, I should build code that enforces that.
	</p>
END
	),
	'JavaScript' => array(
		'title' => 'Research JavaScript more and get JavaScript redirects set up',
		'priority' => 'low',
		'urgency' => 'low',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		I haven&apos;t been on my own Web server in ages, and as such, have been unable to use proper $a[HTTP] redirects.
		Until I&apos;m back on my own server, I should have JavaScript redirects set up to deal with cases where people either access the site without $a[TLS] or access the site using the wrong host name.
	</p>
END
	),
	'martial' => array(
		'title' => 'Learn a martial art',
		'priority' => 'medium',
		'urgency' => 'low',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		I&apos;ve wanted to learn a martial art for a while now.
		Martial arts training is supposed to help with discipline and fitness, both of which I need more of.
		It wouldn&apos;t be bad having a way to defend myself either in the unlikely event that I&apos;m ever attacked.
		With no way to get terms ahead in my coursework during slow periods, there&apos;s no way I can be sure  can dedicate time to martial arts training during busy periods.
		I&apos;ll need to complete my schooling before I even begin martial arts training.
	</p>
END
	),
	'vasectomy' => array(
		'title' => 'Get a vasectomy',
		'priority' => 'high',
		'urgency' => 'low',
		'postrequisites' => array(
			
		),
		'prerequisites' => array(),
		'body' => <<<END
	<p>
		After doing some thinking, I came to the conclusion that the post-vasectomy risk of accidental conception is worth it because there&apos;s an even greater chance that I could talk someone out of having children.
		I think what I find so unattractive about females is the risk of pregnancy and the fact that I&apos;m not the one that would get pregnant.
		(If I was the one to get pregnant, I could know with complete certainty that the pregnant one, me, would make the right choice and get an abortion.)
		If I greatly reduce the chance of pregnancy by getting a vasectomy, I think I could be bisexual instead of being exclusively attracted to males.
	</p>
END
	),
);

foreach($goals as $key_prerequisite => $value_goaldata):
	foreach($value_goaldata['postrequisites'] as $key_postrequisite => $_):
		$goals[$key_postrequisite]['prerequisites'][$key_prerequisite] = true;
	endforeach;
endforeach;

foreach($goals as $key_prerequisite => $value_goaldata):
	if(count($value_goaldata['prerequisites'])):
		foreach($value_goaldata['prerequisites'] as $key => $_):
			$value_goaldata['prerequisites'][$key] = "<a href=\"#$key\">#$key</a>";
		endforeach;
		$goals[$key_prerequisite]['prerequisites'] = implode(', ', $value_goaldata['prerequisites']);
	else:
		$goals[$key_prerequisite]['prerequisites'] = 'none';
	endif;
	if(count($value_goaldata['postrequisites'])):
		foreach($value_goaldata['postrequisites'] as $key => $_):
			$value_goaldata['postrequisites'][$key] = "<a href=\"#$key\">#$key</a>";
		endforeach;
		$goals[$key_prerequisite]['postrequisites'] = implode(', ', $value_goaldata['postrequisites']);
	else:
		$goals[$key_prerequisite]['postrequisites'] = 'none';
	endif;
endforeach;

unset($key_prerequisite, $value_goaldata, $value_goaldata);

// Automated navigation menu for the coursework section
foreach($coursework as $key_code => $value_array):
	$assignment_array = array();
	foreach($value_array['assignments'] as $key_href => $value_assignment):
		$assignment_array[] = "<a href=\"/en/coursework/$key_code/$key_href.xhtml\" title=\"{$value_assignment['title']}\">Unit {$value_assignment['unit']}</a>";
	endforeach;
	$coursework_nav[$key_code] = implode(" |\n\t\t", $assignment_array);
endforeach;

unset($key_code, $value_array, $assignment_array, $key_href, $value_assignment);

// The following variable names are reserved, and may be declared in
// in any file. However, because they can be declared in any file, they
// cannot be assumed in any file to be empty before use.
//
// $key and variable names beginning in "$key_":
//     Reserved for use in "foreach" statements.
// $value and variable names beginning in "$value_":
//     Reserved for use in "foreach" statements.
// $i:
//     Reserved for use in "for" statements.
// $canary:
//     Currently used by the main build script to contain the warrant
//     canary's contents.
// $dirname:
//     Used in any file to refer to the name of a directory that needs
//     to be checked for existence, then created if nonexistent. (This
//     should be fixed with a function at some point.)
// $moved:
//     Currently used in the file dealing with redirect pages.
// $_:
//     Used when a value is required to be assigned to a variable, but
//     we have no intention of actually reading that variable's value.
// $current_entry:
//     Used in some of the weblog-specific code to hold the year,
//     month, and day numbers. This code may need to be rewritten once
//     path-specific code has been set up.
// $datetime:
//     Used in some navigation code that needs to be cleaned up.
// $previous:
//     Used in some navigation code that needs to be cleaned up.
// $next:
//     Used in some navigation code that needs to be cleaned up.
// $URI_path_minus_slash:
//     Set to the HTTP path of the webpage, minus the slash at the
//     beginning.
// $xhtml:
//     An array of page-specific variables used by the main template.
// $checkpath:
//     A variable used on the main template to build the links to the
//     XHTML/CSS conformance checker. This code should probably be
//     cleaned up.
// $time_script_started:
//     This variable holds the time that the script started, for
//     statistical purposes. It can't be declared in this file simply
//     because it needs to be declared before this file is require()d.
// $time_until_script_ended:
//     This variable holds the time that the script took to complete,
//     for statistical purposes. It can't be declared in this file
//     simply because it needs to be declared at the end of the main
//     script.
// $censored_pages:
//     This variable is used to count the number of pages that are
//     currently censored.

// NOTES:
// "weblog_index.php" majorly needs to be cleaned up later.
//
// Closures are also not included in this file. All variable names
// beginning in "$¢" are reserved for use as closures.
